package com.itheima.day02.jiekou;

import java.util.ArrayList;

public class CM1 implements A{

    @Override
    public void printallinfo(ArrayList<STUDENT> s) {
        System.out.println("——————————全部学生信息如下——————————");
        for (int i = 0; i < s.size(); i++) {
            System.out.println("姓名："+s.get(i).getName()+
                    "性别："+s.get(i).getSex()+
                    "成绩："+s.get(i).getScore());
        }
        System.out.println("_________________________________");
    }


    @Override
    public void printaverage(ArrayList<STUDENT> s) {
        double sum = 0;
        for (int i = 0; i < s.size(); i++) {
            sum += s.get(i).getScore();
        }
        System.out.println("平均分为："+sum/s.size());

    }
}
